-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "Revert "Global logging format changes" (#34126)" #34182
Conversation
2318d38
to
3a9a520
Compare
@krfricke @sihanwang41 can you guys approve this PR again? It is the revert-revert |
Also, @c21 |
edb8fbc
to
42f540c
Compare
ef402d4
to
1772154
Compare
cc @peytondmurray seems like it is ready to go? Can you convert it to regular PR? @krfricke @c21 @sihanwang41 please approve the PR. It is the revert-revert, and there shouldn't be any new change (the issue was we set propagate=True to the root logger, which was the changed behavior) |
|
053379e
to
9f0f798
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cc @peytondmurray can you resolve the conflict before merging it? |
52fce63
to
a4a1fa6
Compare
a4a1fa6
to
c4a19ce
Compare
Huh, so I rebased on |
574e1fb
to
a97b7fd
Compare
Rebased to get rid of the |
a97b7fd
to
2bcafd7
Compare
|
@rkooo567 About the So after talking with @DmitriGekhtman about this:
I tried testing on the |
2bcafd7
to
266d2fb
Compare
@rkooo567 Looks like the failing test was fixed on |
This reverts commit 45d5f65. Signed-off-by: pdmurray <[email protected]>
Signed-off-by: pdmurray <[email protected]>
Signed-off-by: pdmurray <[email protected]>
266d2fb
to
6754aac
Compare
Failures seem unrelated |
Test failing tests seem to fail in the master as well |
Since #34182, the docs build on M1 mac had been broken
…ay-project#34182) Attempts to consolidate logging configuration by introducing reasonable defaults in ray/log.py. This new logging configuration is done once in ray/__init__.py at the top of the module. Subsequent calls to the configuration are ignored. A logger for ray.rllib is configured at the WARN level, to address Revert "Simplify logging configuration. (ray-project#30863)" ray-project#31858. With this change, Revert "Simplify logging configuration. (ray-project#30863)" ray-project#31858 can be reverted, again simplifying and consolidating logging configuration. Modified test_output.py::test_logger_config to test only the logger config, not launch a ray cluster. The test was failing intermittently, I think due to a race condition between the launch of the cluster and the reading of the subprocess's stdout, and anyway it wasn't necessary to call ray.init here to check that logging was configured correctly. Modified python/ray/tune/tests/test_commands.py::test_ls_with_cfg to test the underlying data, not what gets printed to stdout (which has changed with the new logging system). Modified a logging message in ray.tune.automl.search_policy.AutoMLSearcher.on_trial_complete, which in certain cases emits a logging message which tries to format a NoneType into a %f during log message formatting. This was a previously-undetected bug which showed up because the default log level is now INFO. This fixes a test that was failing in test_automl_searcher.py::AutoMLSearcherTest.
Since ray-project#34182, the docs build on M1 mac had been broken
…ay-project#34182) Attempts to consolidate logging configuration by introducing reasonable defaults in ray/log.py. This new logging configuration is done once in ray/__init__.py at the top of the module. Subsequent calls to the configuration are ignored. A logger for ray.rllib is configured at the WARN level, to address Revert "Simplify logging configuration. (ray-project#30863)" ray-project#31858. With this change, Revert "Simplify logging configuration. (ray-project#30863)" ray-project#31858 can be reverted, again simplifying and consolidating logging configuration. Modified test_output.py::test_logger_config to test only the logger config, not launch a ray cluster. The test was failing intermittently, I think due to a race condition between the launch of the cluster and the reading of the subprocess's stdout, and anyway it wasn't necessary to call ray.init here to check that logging was configured correctly. Modified python/ray/tune/tests/test_commands.py::test_ls_with_cfg to test the underlying data, not what gets printed to stdout (which has changed with the new logging system). Modified a logging message in ray.tune.automl.search_policy.AutoMLSearcher.on_trial_complete, which in certain cases emits a logging message which tries to format a NoneType into a %f during log message formatting. This was a previously-undetected bug which showed up because the default log level is now INFO. This fixes a test that was failing in test_automl_searcher.py::AutoMLSearcherTest. Signed-off-by: e428265 <[email protected]>
Since ray-project#34182, the docs build on M1 mac had been broken Signed-off-by: e428265 <[email protected]>
This PR changes how the logging configuration for Ray is set, and changes the format of log messages.
Why are these changes needed?
Changes
ray/log.py
.ray/__init__.py
at the top of the module. Subsequent calls to the configuration are ignored.ray.rllib
is configured at the WARN level, to address Revert "Simplify logging configuration. (#30863)" #31858. With this change,Revert "Simplify logging configuration. (#30863)" #31858 can be reverted, again simplifying and consolidating logging configuration.
test_output.py::test_logger_config
to test only the logger config, not launch a ray cluster. The test was failing intermittently, I think due to a race condition between the launch of the cluster and the reading of the subprocess's stdout, and anyway it wasn't necessary to callray.init
here to check that logging was configured correctly.python/ray/tune/tests/test_commands.py::test_ls_with_cfg
to test the underlying data, not what gets printed to stdout (which has changed with the new logging system).ray.tune.automl.search_policy.AutoMLSearcher.on_trial_complete
, which in certain cases emits a logging message which tries to format aNoneType
into a%f
during log message formatting. This was a previously-undetected bug which showed up because the default log level is nowINFO
. This fixes a test that was failing intest_automl_searcher.py::AutoMLSearcherTest
.New changes since the revert
propagate = False
to theray
logger, which matches the behavior of the currentmaster
branch. The implication of this is that some tests broke, because in the currentmaster
branch some tests calledray.init(setup_logging=False)
, and no logging configuration was generated, i.e. the default behavior was to propagate messages up to the root logger. Tests which rely oncaplog
therefore expect to be able to examine log messages this way becausecaplog
attaches a special logging handler to the root logger.The fix for these tests is to always use the
propagate_logs
pytest fixture, which was already being used in many places, everywherecaplog
was being used. This ensures messages are propagated beyond theray
logger to the root logger, and thatcaplog
would be able to examine log messages once again.Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.